package com.imau.service.impl;

import com.imau.dao.BookDao;
import com.imau.dao.UserDao;
import com.imau.dao.impl.BookDaoImpl;
import com.imau.service.BookService;

public class BookServiceImpl implements BookService {
    private BookDao bookDao;

    private UserDao userDao;

    private int connectionNum;

    public BookServiceImpl(BookDaoImpl bookDao, UserDao userDao) {

        this.bookDao = bookDao;
        this.userDao = userDao;
    }

    public BookServiceImpl(){}

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    public void setConnectionNum(int connectionNum) {
        this.connectionNum = connectionNum;
    }

    @Override
    public void save() {
        bookDao.add();
        userDao.add();
        System.out.println(connectionNum);
        System.out.println("book service save ...");
    }
}
